package com.molichuxing.services.property;

/**
 * 是否上架状态（0：上架，1：下架）
 * @author xuelin yi
 */
public enum GoodsUpperSelfEnum {

  UPPER_SELF(0, "已上架"),LOWER_SHELF(1, "已下架");

  int value;
  String name;

  GoodsUpperSelfEnum(int value, String name) {
    this.value = value;
    this.name = name;
  }

  public int getValue() {
    return value;
  }

  public String getName() {
    return name;
  }

  /**
   * 通过value获取枚举的name
   * @param value
   * @return
   */
  public static GoodsUpperSelfEnum getName(int value) {
    for (GoodsUpperSelfEnum orderSource : GoodsUpperSelfEnum.values()) {
      if (orderSource.getValue() == value) {
        return orderSource;
      }
    }
    return null;
  }
}
